{
 "metadata": {
  "name": "",
  "signature": "sha256:af1f2f5b0989306de482ca74ac845bd28bf9febc4a101dc5696ea773077a9e0e"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import numpy as np\n",
      "import matplotlib.pyplot as plt\n",
      "from rockfish2 import get_example_file\n",
      "from rockfish2.navigation.utils.cartesian import build_rectangular_bins\n",
      "from rockfish2.navigation.p190 import P190"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "/Users/ncm/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/io/excel.py:626: UserWarning: Installed openpyxl is not supported at this time. Use >=1.6.1 and <2.0.0.\n",
        "  .format(openpyxl_compat.start_ver, openpyxl_compat.stop_ver))\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "p190 = P190(get_example_file('MGL1407MCS15.TEST.p190'))\n",
      "mp = p190.calc_midpoints()\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "[2014-10-16 22:38] INFO: rockfish: Creating new database: :memory:\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "[2014-10-16 22:38] INFO: rockfish: Reading p190 data from: /Users/ncm/Dev/Rockfish2/rockfish2/navigation/p190/tests/data/MGL1407MCS15.TEST.p190\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "sql = 'SELECT midpoint_easting as x, midpoint_northing as y FROM receiver_groups WHERE receiver_group=230'\n",
      "line = p190.read_sql(sql)\n",
      "\n",
      "_ = p190.create_cmp_line(line.x, line.y, if_exists='replace')\n",
      "\n",
      "sql = 'SELECT bin, easting as x, northing as y FROM cmp_line'\n",
      "cmps = p190.read_sql(sql)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 3
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "plot(cmps.x, cmps.y, '.k')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 4,
       "text": [
        "[<matplotlib.lines.Line2D at 0x110faf350>]"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGxdJREFUeJzt3X9wHOd52PEvExCoZMs6a2QQFGUTsEIxZKpYMiNTM2mC\ns2wq9DRjMm0TUTNRFViWR+WM5DaeRKTSmGg6SRknbqvORMo4sn6lIzaiY9CUKdMSXZ2ihrEpKZJM\nmyQAyhFtMAZh1USUtglxGrN/vO/hFsc74ADc4X7s9zNzc3vv7t3uLZd473mf930XJEmSJEmSJEmS\nJEmSJEmSJC3CfwReBV4Bvga8u8J2rwPfBF4GjiTK3wf8VVy3H7gklv8TYE8sPwbsqPJ4fhcYju+5\nq8r3SJIWKQs8XFJ2SWL5LuDBCu/9G+CyMuUvAD8XlweA34nLv0aoIAAuiu9/zxzHNwA8knj9rjm2\nl6SW82ONPoAKzpcp+/vE8tuBN2Z5/7IyZWuA5+PyIeBfxuXvA28Dfjw+TwFvxnU3AYeBl4An4nqA\nOylWMAA/mOVYJEk1lOXCCAJCs853gRNApsJ7v0NoXnoRuCNR/pfAlrj86xQrAYD/DkwA/wf4eCy7\nHHiOEFUA3AP8dlx+A7iXEJU8BfzE3F9JkrQYXyf8cR8F/ndcfhnYVLLdDspXIAAr4/O7CPmKQrPS\nWuCrhIrj0xQjkF8F/pwQQbyLUPn0Ab9IiAwKx/Bt4E/ie/4e+Hdx+ZeAv5jXt5QkLVg/lSsACDmC\nb1XxObuAT5Upv5pQGQHcT6gkCj4P/DKhgni8wuceB1b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4RpCsmmc\ndJ2LCdJ3XXyb4gwEAL9Esa09bdfFbOcijdfFlyjmIK4mXAdv0MLXRekAukLXraOErPufE34lAvwL\nQtetlwl/MP554nMKXbVOAv8tUd5FCLMKXbV66/M1aqLcYMKk7zCzDbDSYMK0nYu0XRcZ4DFCLuZV\nYB/FiS4hXdfFbOcibdfFpYReSn9K+G4vAdnE9u18XUiSJEmSJEmSJEmSJEmSJEmSJEmStDj/H2u9\nioIlsYyFAAAAAElFTkSuQmCC\n",
       "text": [
        "<matplotlib.figure.Figure at 0x1123b2310>"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "sql = 'SELECT midpoint_easting as x, midpoint_northing as y FROM receiver_groups'\n",
      "mp = p190.read_sql(sql)\n",
      "\n",
      "plot(mp.x, mp.y, '.k')\n",
      "plot(cmps.x, cmps.y, '.r')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 5,
       "text": [
        "[<matplotlib.lines.Line2D at 0x10043bd90>]"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3W10XNV97/Gv5AcCwfKR/IBtiM8IsEl8QWOQsZ1ohIdc\nzLVVg2Hda4dcFjc0uSFZtCQrabuC06bWTVYbmjZtyQvoWiUN0FxI7eTWBSobEPEkklPsYOyRDTh+\n0gyxwDa2NZZpEvwg3Rf7HOt4PKMZaebM4++zltac2XPmnL2XpNmz938/gIiIiIiIiIiIiIiIiIiI\niIiIiIiIiOToW0AU2Am8AnwkzXkxoAfYAWzzpAeB/3Beew6Y5KTf65zr/pwDmrLIz18AvwLeBB7K\nvhgiIpKLMPCDpLRJnuOHgCfSvLcXaEiR/kug1Tn+feCbKc65HtiXRf5+H3j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clvT9L5lVI+MC2/\nKPB9hgePlFP5UpXtw8Ac4BZMl0kEWOCcX05lg8yfLa2YyccHnOe+l8+PCmI8poXwmPP4nwzPgagE\nmcr3p8Bp4JnCZy0vRirfnwKzMX/Af1+U3OUuVfn+D+bb2FrPeeU6BDvd7+8xzAfQfMzk1u8WK4M5\nSFe28UA95tvzn2BaFOUo02fLpynw54ofFcQh5+eXzvMfc3FQ2quPCwOeVznv73OOk9Pd98x2jt1+\nuhM55Tp7I5XvfqANuNdzfiWVz/UMcLNzXAnluxHThxvFdC9dBWzHLBNTCeW7CfPN1F3Z4AmG+6fL\nqXzpfne/xgwMwXltEJhKeZUNRv7fG4/puv4Xz/m+l8+PCuIw5hc213l+G2b0kpf329lzmD4ydwLd\nHEyA5TAwgOkvqwHuA/7N857POMf/AzOqplDSlW8Z5tvLSuB3nvMrpXzeWZorGR5JUQnl2w7MwOS/\nEfPPdBOmOV8J5XsDUz7X3ZgRLlBe5UtXtn9jOAYxF1OWY5RX2WDkz87bMHGFdzznl1v5zgtiakHv\nkM+7MYX/LaYAGz3np5tA5w7V2g98z5N+CaYZ6Q7VCvhQhpEkl89y8hJneDjaY57zK6F8P8bkdSfw\nE2C65/xyL1/ySJGDXNgvW+7ls4CnMfGVKLCB4UU0obzKl+p3NwH4Zyev2zFL/bjKqWyQ/m/zB8AD\nKc4vt/KJiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIgUzv8HHw0Aqp+y6rYAAAAASUVORK5CYII=\n",
       "text": [
        "<matplotlib.figure.Figure at 0x110f9a150>"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Layout rectangular bins"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "binx, biny = build_rectangular_bins(cmps.x, cmps.y, 6.25, 50.)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 6
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "for i in range(0, len(cmps), 10):\n",
      "\n",
      "    plot(binx[i], biny[i], '.-r')\n",
      "    plot(cmps.x[i], cmps.y[i], '.k')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xt0lHWe5/E3aqCpkFBcwkVicxMhdKPBpMELSmm3DpZ9\nBmba8jKnEVCs0+uZ7t6dOXars9Owu2dmnd6d3XXO2Z45mR6DzhK2C9t2cMfQHUaSlm4RhQCRWwgK\nEjRggCKAXBKS/eP7VKoIqUsuldTl8zqnTj31q6eqnjw81Ld+v+/vAiIiIiIiIiIiIiIiIiIiIiIi\nIiIiItIH/wXYBewE/g24Kcp+h4HdQC2wLaL8NuA957kNQJ5T/hVgnVO+F3g+weP5K+CA85rvJ/ga\nERHpIw9Q3qUsL2L7+8DPo7z2E2B0N+UfAPc42yuA/+xsL8cCBMBw5/VfjXN8K4A1EY8L4uwvIpJ2\nrhvsA4iio5uysxHbI4DmGK8f0k3ZDOBdZ3sT8B1n+3MgF7jeub8MtDjPPQj8HtgOBJznAb5HOMAA\nfBHjWEREpB95uLYGAdas8ymwH3BHee3HWPPSh8AzEeW/AxY7239GOAgA/B/gBHAOWOmUjQVqsFoF\nwI+Bv3S2m4EXsVrJ28DN8f8kERHpi63Yl/tB4KSzXQs80GW/5+k+gABMdO4LsHxFqFlpJvBrLHD8\nhHAN5LvAL7EaRAEWfKYC38ZqBqFj2AP8o/Oas8B/cLb/CPhtj/5KERHptYVEDwBgOYKPEnifVcCf\nd1N+CxaMAH6GBYmQfwJ8WICoiPK++4DJzvYQIJjAsYiIpJV4OYibgM3Yr+ePgB845aOBKqAe+A1X\nN/e8gNUA9mNt+CElQJ3z3MtxPjdaDiFkMfarvisX4WR2rvP5dc7jUCL5Ou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dF7djvx5DA59+\nTrgNOduui1jnItuui7nYL/43nLIPsM4cYxmA6yIZAaIJ+4NCA+i+BewBbo7YZzFWRQT7Q693tqdh\n/9gfY78aWrD2siHAUuBfnP02YM1UAI9gvaJSUXfnYjs20nyqc2vE/kMcx/6uxwkPJpyBJZuayK5z\ncYLsuy72EJ6BAOCPCLe1Z9t1EetcZON18S+EcxC3YNdBM2l8XXQdQBfqulWHZd1/if1KBPhjrOtW\nLfaF8XDE+4S6ajUAfxdRPgyrZoW6ak1Jzp/RL7obTBjpY65uA4w2mDDbzkW2XRdu4DUsF7MLeJPw\nRJeQXddFrHORbdfFSKyX0j9jf9t2wBOxfyZfFyIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIn3z\n/wEll9/6THDUqQAAAABJRU5ErkJggg==\n",
       "text": [
        "<matplotlib.figure.Figure at 0x1130609d0>"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "# for a lot of points\n",
      "x = np.arange(0, 10000)\n",
      "y = np.zeros(len(x))\n",
      "\n",
      "binx, biny = build_rectangular_bins(x, y, 6.25, 50.)"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Assign bins"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from shapely.geometry import Polygon, Point"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 8
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "polys =  build_rectangular_bins(cmps.x, cmps.y, 6.25, 50., as_shapely=True)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 9
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "pt = Point(cmps.x[200], cmps.y[200])\n",
      "\n",
      "inpoly = np.nonzero([p.contains(pt) for p in polys])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 14
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "inpoly"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 15,
       "text": [
        "(array([200]),)"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}